﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace BL.BetterControls
{
    [Serializable]
    public enum _ZurbGridType
    {
        Row, Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10, Col11, Col12
    }


    
    /// <summary>
    /// runtat="server" Genererar en massa overhead så använd inte det här
    /// </summary>
    [ToolboxData("<{0}:_ZurbGrid runat=\"server\"></{0}:_ZurbGrid>")]
    public class _ZurbGrid : HtmlContainerControl
    {

        public _ZurbGridType ZurbGridType { get; set; }
        public string cssClass { get; set; }

        public override string TagName
        {
            get
            {
                return "div";
            }
        } 

        protected override void Render(HtmlTextWriter output)
        {

            this.Attributes["class"] = "";

            switch (ZurbGridType)
            {
                case _ZurbGridType.Row:
                    this.Attributes["class"] = "row";
                    break;
                case _ZurbGridType.Col1:
                    this.Attributes["class"] = "one columns";
                    break;
                case _ZurbGridType.Col2:
                    this.Attributes["class"] = "two columns";
                    break;
                case _ZurbGridType.Col3:
                    this.Attributes["class"] = "three columns";
                    break;
                case _ZurbGridType.Col4:
                    this.Attributes["class"] = "four columns";
                    break;
                case _ZurbGridType.Col5:
                    this.Attributes["class"] = "five columns";
                    break;
                case _ZurbGridType.Col6:
                    this.Attributes["class"] = "six columns";
                    break;
                case _ZurbGridType.Col7:
                    this.Attributes["class"] = "seven columns";
                    break;
                case _ZurbGridType.Col8:
                    this.Attributes["class"] = "eight columns";
                    break;
                case _ZurbGridType.Col9:
                    this.Attributes["class"] = "nine columns";
                    break;
                case _ZurbGridType.Col10:
                    this.Attributes["class"] = "ten columns";
                    break;
                case _ZurbGridType.Col11:
                    this.Attributes["class"] = "eleven columns";
                    break;
                case _ZurbGridType.Col12:
                    this.Attributes["class"] = "twelve columns";
                    break;
                default:
                    break;
            }

            base.Render(output);
        }
    }
}
